package com.yin.task;

import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
*@author LSY
*Time: 2018年12月28日上午9:44:22
*
*
*/
@Component
public class TestTask {

	/*@Scheduled(cron = "0/5 * * * * ?")
	public void cron() throws Exception {
		System.out.println("执行测试cron时间：" + new Date(System.currentTimeMillis()));
	}*/
	
	/*@Scheduled(fixedRate = 5000)
	public void fixedRate() throws Exception {
		Thread.sleep(2000);
		System.out.println("执行测试fixedRate时间：" + new Date(System.currentTimeMillis()));
	}*/
	
	@Scheduled(fixedDelay = 5000)
	public void fixedDelay() throws Exception {
		Thread.sleep(2000);
		System.out.println("执行测试fixedDelay时间：" + new Date(System.currentTimeMillis()));
	}
}
